package com.big.app.controller;

import com.big.app.service.UserService;
import com.big.app.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/user/")
@Api(value = "用户接口",tags = "用户接口")
public class UserController {
    @Autowired
    private UserService service;

        //验证码登录
    @GetMapping("login.do")
    @ApiOperation(value = "登陆")
    R login(String phone, int code, String ip) {
       return service.login(phone, code, ip);
    }
    //查询用户详情
    @GetMapping("query.do")
    @ApiOperation(value = "查询用户")
    R query(String token){
        return service.query(token);
    }
    //校验令牌
    @GetMapping("checkToken.do")
    @ApiOperation(value = "校验令牌")
    R checkToken(String token){
        return service.checkToken(token);
    }
    //注销，退出
    @GetMapping("loginout.do")
    @ApiOperation(value = "退出")
    R loginout(String token){
        return service.loginout(token);
    }

}
